package rules.feedback;

import rules.Rule;
import exceptions.BadFormedPersonFeedbackException;
import feedback.PersonFeedback;

/**
 */
public class PersonFeedbackNotNullFieldsRule implements Rule<PersonFeedback> {

    @Override
    public void validate(final PersonFeedback fb) {
        if (fb.getBook() == null || fb.getComment() == null || fb.getDate() == null || fb.getPerson() == null
                || fb.getRate() == null) {
            throw new BadFormedPersonFeedbackException();
        }
    }

}
